<div class="m-l nav navbar-nav m-t block" style="width:300px;" >  
  <span>用户管理 ></span>  
  <span>普通用户 ></span> 
  <span>列表</span>      
</div>
<div class="m-t-lg">
  <div class="wrapper-sm">
	<div class="panel panel-default">
		<div class="panel-body">
			<div style="border-color: #e5e5e5;padding: 10px;background-color: #e5e5e5">
				<div class="row">					
					<div class="col-md-6">
						<div class="input-group">
					      <input type="text" class="form-control" placeholder="手机号..." [(ngModel)]="usertelephone" >
					      <span class="input-group-btn">
					        <button class="btn btn-default" type="button" (click)="getSearchdata()">查询</button>
					      </span>
					    </div>
					</div> 
					<!-- <div class="col-md-4" style="text-align: right">
						<button class="btn btn-info" (click)="myModal.show()">
							新增
						</button>
					</div> -->			
				</div>
			</div>
			<div class="table-responsive">
			<table class="table table-hover table-striped">
				<thead>
					<tr>
						
	   					<th>用户ID</th>	   					
	   					<th>手机号</th>
	   					<th>账户余额</th>
	   					<th>信用值</th>
	   					<th>注册日期</th>
	   					<!-- <th>关联账户</th> -->
	   					<!-- <th>关联账号昵称</th> -->
	   					<th>认证状态</th>
	   					<th>姓名</th>
	   					<th>身份证号</th>
	   					<th>操作</th>
	   					
					</tr>
				</thead>
				<tbody>
					<tr *ngFor="let userdata of userdata">						
	   					<td>{{userdata.id}}</td>
	   					<td>{{userdata.user_telephone}}</td>
	   					<td>{{userdata.wallet_money}}</td>
	   					<td>{{userdata.id}}</td>
	   					<td>{{userdata.created_at}}</td>
	   					<!-- <td> -->
	   						<!-- <i class="fa fa-weixin" style="color: green"></i> -->
	   				<!-- 		{{userdata.identify_card}}
	   					</td> -->
	   					<!-- <td>{{userdata.id}}</td> -->
	   					<td>
	   					<!-- <i class="fa fa-check" style="color: green"></i> -->
	   						{{userdata.identify_status}}
	   					</td>
	   					<td>{{userdata.identify_name}}</td>
	   					<td>{{userdata.identify_card}}</td>
	   				
	   					<td>
	   						<button class="btn btn-xs btn-danger" (click)="btype=1;myModal.show()">禁用</button>
	   						<!-- <button class="btn btn-xs btn-info" (click)="btype=2;myModal.show()">重置密码</button> -->
	   					</td>
					</tr>
				</tbody>
			</table>
			</div>
			<app-pagination [pageModel]="pageModel" (pageChanged)="getData($event)"></app-pagination>
		</div>
	</div>
  </div>
</div>

<div>
  <div bsModal #myModal="bs-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-lg" style="width: 800px">
      <div class="modal-content">
		  <div class="modal-header">
		    <h4 class="modal-title" *ngIf="btype==2">重置密码</h4>
		    <h4 class="modal-title" *ngIf="btype==1">禁用</h4>		  
		  </div>
		  <div class="modal-body">
		    <form class="form-horizontal" *ngIf="btype==2">
		        <div class="form-group row" >
		          <label class="col-sm-3  control-label" style="text-align: right">旧密码</label>
		          <div class="col-sm-7">
		            <input type="text"  class="form-control" placeholder="旧密码" name="oldpassword" [(ngModel)]='oldpassword'  required="">
		          </div>
		          <div class="col-sm-2" style="color:red;margin-top: 10px;">
		            <p [hidden]="oldpassword">必填</p>
		          </div>
		        </div> 
		        <div class="form-group row" >
		          <label class="col-sm-3  control-label" style="text-align: right">新密码</label>
		          <div class="col-sm-7">
		            <input type="text"  class="form-control" placeholder="新密码" name="newpassword" [(ngModel)]='newpassword'  required="">
		          </div>
		          <div class="col-sm-2" style="color:red;margin-top: 10px;">
		            <p [hidden]="newpassword">必填</p>
		          </div>
		        </div>      
		        <div class="form-group row" >
		          <label class="col-sm-3  control-label" style="text-align: right">确认密码</label>
		          <div class="col-sm-7">
		            <input type="text"  class="form-control" placeholder="确认密码" name="comfirmpassword" [(ngModel)]='comfirmpassword'  required="">
		          </div>
		          <div class="col-sm-2" style="color:red;margin-top: 10px;">
		            <p [hidden]="comfirmpassword">必填</p>
		          </div>
		        </div>
		    </form>
		    <div *ngIf="btype==1">
		    	<div style="background-color: #e5e5e5;padding: 10px;border-radius: 5px;">
		    		<h4>确定要禁用嘛？</h4>
		    	</div>
		    </div>
		  </div>
		  <div class="modal-footer">
		    <button class="btn btn-info confirm-btn" (click)="open()" [disabled]="!oldpassword||!newpassword||!comfirmpassword" *ngIf="btype==2">保存</button>
		    <button class="btn confirm-btn btn-danger" (click)="open()" *ngIf="btype==1">确定</button>
		    <button class="btn  confirm-btn " (click)="myModal.hide();cancel();">取消</button>
		  </div>
		</div>
     
    </div>
  </div>
</div>